import request from "@/utils/request";
import { ParamsType } from "@/api/system/corps/types";

/**
 * 建设单位库列表
 * @param pages
 */
export function getConstructorList(pages: ParamsType) {
  return request({
    url: "api/v1/sysuser/Constructor/page",
    method: "get",
    params: pages,
  });
}

/**
 * 建设单位详情
 */
export function getConstructorsInfo(id: number) {
  return request({
    url: `api/v1/sysuser/Constructor/${id}/form`,
    method: "get",
  });
}

//修改建设单位信息
export function updateConstructor(id: number, data: CorpForm) {
  return request({
    url: "/api/v1/sysuser/Constructor/" + id,
    method: "put",
    data: data,
  });
}

//删除建设单位信息
export function deleteConstructor(id: number) {
  return request({
    url: "/api/v1/sysuser/Constructor/" + id,
    method: "delete",
  });
}

/**
 * 重置密码
 * @param id
 */
export function ResetPassword(id: number, password: string) {
  return request({
    url: "/api/v1/sysuser/Constructor/resetPassword/" + id,
    method: "put",
    params: {
      password: password,
    },
  });
}
